<?php
namespace BP\Frm;
require_once("BP/En/Map.php");
require_once("BP/Web/WebUser.php");
class Track extends EntityMyPK {
	public $FrmDB;	// String
	public $FK_Flow;	// String
	public $RptName;	// String
	private function __init() { // default class members
		$this->FrmDB = NULL;
		$this->FK_Flow = NULL;
		$this->RptName = NULL;
	}
	public function getNDFrom () 
	{
		return $this->GetValIntByKey(TrackAttr::$NDFrom);
	}
	public function setNDFrom ($value) // [int value]
	{
		$this->SetValByKey(TrackAttr::$NDFrom, $value);
	}
	public function getNDTo () 
	{
		return $this->GetValIntByKey(TrackAttr::$NDTo);
	}
	public function setNDTo ($value) // [int value]
	{
		$this->SetValByKey(TrackAttr::$NDTo, $value);
	}
	public function getEmpFrom () 
	{
		return $this->GetValStringByKey(TrackAttr::$EmpFrom);
	}
	public function setEmpFrom ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$EmpFrom, $value);
	}
	public function getEmpTo () 
	{
		return $this->GetValStringByKey(TrackAttr::$EmpTo);
	}
	public function setEmpTo ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$EmpTo, $value);
	}
	public function getTag () 
	{
		return $this->GetValStringByKey(TrackAttr::$Tag);
	}
	public function setTag ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$Tag, $value);
	}
	public function getRDT () 
	{
		return $this->GetValStringByKey(TrackAttr::$RDT);
	}
	public function setRDT ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$RDT, $value);
	}
	public function getFID () 
	{
		return $this->GetValInt64ByKey(TrackAttr::$FID);
	}
	public function setFID ($value) // [long value]
	{
		$this->SetValByKey(TrackAttr::$FID, $value);
	}
	public function getWorkID () 
	{
		return $this->GetValInt64ByKey(TrackAttr::$WorkID);
	}
	public function setWorkID ($value) // [long value]
	{
		$this->SetValByKey(TrackAttr::$WorkID, $value);
	}
	public function getCWorkID () 
	{
		return $this->GetValInt64ByKey(TrackAttr::$CWorkID);
	}
	public function setCWorkID ($value) // [long value]
	{
		$this->SetValByKey(TrackAttr::$CWorkID, $value);
	}
	public function getHisActionType () 
	{
		return $ActionType->forValue($this->GetValIntByKey(TrackAttr::$ActionType));
	}
	public function setHisActionType ($value) // [ActionType value]
	{
		$this->SetValByKey(TrackAttr::$ActionType, $value->getValue());
	}
	public static function GetActionTypeT ($at) // [ActionType at]
	{
		switch ($at) {
			case $Forward:
				return "发�??";
			case $Return:
				return "�?�?";
			case $ReturnAndBackWay:
				return "�?回并原路返回";
			case $Shift:
				return "移交";
			case $UnShift:
				return "撤消移交";
			case $Start:
				return "发起";
			case $UnSend:
				return "撤消发�??";
			case $ForwardFL:
				return " -前进(分流�?)";
			case $ForwardHL:
				return " -向合流点发�??";
			case $FlowOver:
				return "流程结束";
			case $CallChildenFlow:
				return "子流程调�?";
			case $StartChildenFlow:
				return "子流程发�?";
			case $SubThreadForward:
				return "线程前进";
			case $RebackOverFlow:
				return "恢复已完成的流程";
			case $FlowOverByCoercion:
				return "强制结束流程";
			case $HungUp:
				return "挂起";
			case $UnHungUp:
				return "取消挂起";
			case $Press:
				return "催办";
			case $CC:
				return "抄�??";
			case $WorkCheck:
				return "审核";
			case $ForwardAskfor:
				return "加签发�??";
			case $AskforHelp:
				return "加签";
			case $Skip:
				return "跳转";
			case $HuiQian:
				return "主持人执行会�?";
			case $DeleteFlowByFlag:
				return "逻辑删除";
			case $Order:
				return "队列发�??";
			case $FlowBBS:
				return "评论";
			case $TeampUp:
				return "协作";
			default:
				return ("信息" . $at);
		}
	}
	public function getActionTypeText () 
	{
		return $this->GetValStringByKey(TrackAttr::$ActionTypeText);
	}
	public function setActionTypeText ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$ActionTypeText, $value);
	}
	public function getNodeData () 
	{
		return $this->GetValStringByKey(TrackAttr::$NodeData);
	}
	public function setNodeData ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$NodeData, $value);
	}
	public function getExer () 
	{
		return $this->GetValStringByKey(TrackAttr::$Exer);
	}
	public function setExer ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$Exer, $value);
	}
	public function getMsg () 
	{
		return $this->GetValStringByKey(TrackAttr::$Msg);
	}
	public function setMsg ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$Msg, $value);
	}
	public function getMsgHtml () 
	{
		return $this->GetValHtmlStringByKey(TrackAttr::$Msg);
	}
	public function getEmpToT () 
	{
		return $this->GetValStringByKey(TrackAttr::$EmpToT);
	}
	public function setEmpToT ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$EmpToT, $value);
	}
	public function getEmpFromT () 
	{
		return $this->GetValStringByKey(TrackAttr::$EmpFromT);
	}
	public function setEmpFromT ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$EmpFromT, $value);
	}
	public function getNDFromT () 
	{
		return $this->GetValStringByKey(TrackAttr::$NDFromT);
	}
	public function setNDFromT ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$NDFromT, $value);
	}
	public function getNDToT () 
	{
		return $this->GetValStringByKey(TrackAttr::$NDToT);
	}
	public function setNDToT ($value) // [String value]
	{
		$this->SetValByKey(TrackAttr::$NDToT, $value);
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Frm_Track", "轨迹�?");
		$map->AddMyPK();
		$map->AddTBInt(TrackAttr::$ActionType, 0, "类型",  TRUE ,  FALSE );
		$map->AddTBString(TrackAttr::$ActionTypeText, NULL, "类型(名称)",  TRUE ,  FALSE , 0, 30, 100);
		$map->AddTBInt(TrackAttr::$FID, 0, "流程ID",  TRUE ,  FALSE );
		$map->AddTBInt(TrackAttr::$WorkID, 0, "工作ID",  TRUE ,  FALSE );
		$map->AddTBInt(TrackAttr::$NDFrom, 0, "从节�?",  TRUE ,  FALSE );
		$map->AddTBString(TrackAttr::$NDFromT, NULL, "从节�?(名称)",  TRUE ,  FALSE , 0, 300, 100);
		$map->AddTBInt(TrackAttr::$NDTo, 0, "到节�?",  TRUE ,  FALSE );
		$map->AddTBString(TrackAttr::$NDToT, NULL, "到节�?(名称)",  TRUE ,  FALSE , 0, 999, 900);
		$map->AddTBString(TrackAttr::$EmpFrom, NULL, "从人�?",  TRUE ,  FALSE , 0, 20, 100);
		$map->AddTBString(TrackAttr::$EmpFromT, NULL, "从人�?(名称)",  TRUE ,  FALSE , 0, 30, 100);
		$map->AddTBString(TrackAttr::$EmpTo, NULL, "到人�?",  TRUE ,  FALSE , 0, 2000, 100);
		$map->AddTBString(TrackAttr::$EmpToT, NULL, "到人�?(名称)",  TRUE ,  FALSE , 0, 2000, 100);
		$map->AddTBString(TrackAttr::$RDT, NULL, "日期",  TRUE ,  FALSE , 0, 20, 100);
		$map->AddTBFloat(TrackAttr::$WorkTimeSpan, 0, "时间跨度(�?)",  TRUE ,  FALSE );
		$map->AddTBStringDoc(TrackAttr::$Msg, NULL, "消息",  TRUE ,  FALSE );
		$map->AddTBStringDoc(TrackAttr::$NodeData, NULL, "节点数据(日志信息)",  TRUE ,  FALSE );
		$map->AddTBString(TrackAttr::$Tag, NULL, "参数",  TRUE ,  FALSE , 0, 300, 3000);
		$map->AddTBString(TrackAttr::$Exer, NULL, "执行�?",  TRUE ,  FALSE , 0, 200, 100);
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	public static function constructor__ () 
	{
		$me = new self();
		$me->__init();
		return $me;
	}
	protected function beforeInsert () 
	{
		if ($WebUser->getNo()->equals("Guest"))
		{
			$this->setExer((($BP->Web->GuestUser->getNo() . ",") . $BP->Web->GuestUser->getName()));
		}
		else
		{
			if ($WebUser->getIsAuthorize())
			{
				$this->setExer($BP->WF->Glo->DealUserInfoShowModel($WebUser->getAuth(), $WebUser->getAuthName()));
			}
			else
			{
				$this->setExer($BP->WF->Glo->DealUserInfoShowModel($WebUser->getNo(), $WebUser->getName()));
			}
		}
		if ($DataType->IsNullOrEmpty($this->getRDT()))
			$this->setRDT(DataType->getCurrentDataTimess());
		return parent->beforeInsert();
	}
}
?>
